package com.hxy.service;

import com.hxy.aop.DataSourceSelector;
import com.hxy.domain.User;
import com.hxy.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {


    @Autowired
    private UserMapper userMapper;

    @DataSourceSelector()
    public List<User> listUser() {
        List<User> users = userMapper.getAll();
        return users;
    }



    public void insertone(User user){
         userMapper.insertOne(user);
    }




}
